﻿using System;
using System.Xml.Serialization;
using System.IO;

public class ImageSequence
{
    [XmlAttribute("width")]
    public int Width;

    [XmlAttribute("height")]
    public int Height;

    [XmlAttribute("delay")]
    public int Delay;

    [XmlElement("file")]
    public string[] Files;

    public static ImageSequence FromFile(string path)
    {
        XmlSerializer xsr = new XmlSerializer(typeof(ImageSequence));
        Stream s = File.OpenRead(path);
        ImageSequence result = (ImageSequence)xsr.Deserialize(s);
        s.Close();
        return result;   
    }
}